<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:totoland="http://java.sun.com/jsf/composite/components">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="${request.contextPath}/resources/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
            <script src="${request.contextPath}/resources/js/html5.js"></script>
        <link rel="stylesheet" href="${request.contextPath}/resources/css/style.css" media="screen"/>
        
        <link rel="stylesheet" href="${request.contextPath}/resources/css/style.responsive.css" media="all"/>

    </h:head>
    <h:body id="body020">
        <p:blockUI block="body020"  widgetVar="blogui020">
            LOADING<br />
            <img src="${request.contextPath}/resources/images/preloader-01.gif"/>
        </p:blockUI>
        <p:ajaxStatus onstart="blogui020.show()" oncomplete="blogui020.hide()"/>
        <h:form>

            <p:panel id="REPORT_020" header="#{msg.report_020_header}">

                <p:panel header="#{formReport020Controller.reportTitle}" style="width: 710px;">
                    <p:messages id="REPORT_020msgFrmDetails"></p:messages>                   

                    <script>
                        //<![CDATA[
                        function sum(obj) {
                            if (obj.value != 0) {
                                calSum();
                            }
                            return false;
                        }
                        //]]>
                    </script>

                    <p:remoteCommand name="calSum" update="REPORT_020pnlFrm" onstart="blogui020.show()" oncomplete="blogui020.hide()" action="#{formReport020Controller.sumReport020Details()}">
                    </p:remoteCommand>
                    
                    <div style="width: 700px;overflow-x: scroll">
                        <p:panelGrid columns="2" styleClass="frmDetail" id="REPORT_020pnlFrm"> 
                            <p:panelGrid styleClass="frmDetail" id="REPORT_020Grid">
                                <f:facet name="header">                            
                                    <p:row>  
                                        <p:column rowspan="2" style="width:150px;">รายการ</p:column>
                                        <p:column rowspan="2" style="width:180px;">สนง.กกต.จว. /สำนัก(แห่ง/โครงการ)</p:column>
                                        <p:column colspan="2">งบประมาณ</p:column>                                
                                    </p:row>
                                    <p:row>                              
                                        <p:column>ขอรับการสนับสนุน(จำนวน)</p:column>
                                        <p:column>อนุมัติ(จำนวน)</p:column>                                 
                                    </p:row>
                                </f:facet>                          
                                <p:row>
                                    <p:column><h:outputText value="#{formReport020Controller.report020Details[0].list}"/></p:column>  
                                    <p:column><p:inputText value="#{formReport020Controller.report020Details[0].project}" disabled="#{formReport020Controller.paramMode=='view'}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[0].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[0].approve}"/></p:column>  
                                </p:row>  
                                <p:row>
                                    <p:column><h:outputText value="#{formReport020Controller.report020Details[1].list}"/></p:column>  
                                    <p:column><p:inputText value="#{formReport020Controller.report020Details[1].project}" disabled="#{formReport020Controller.paramMode=='view'}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[1].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[1].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column><h:outputText value="#{formReport020Controller.report020Details[2].list}"/></p:column>  
                                    <p:column><p:inputText value="#{formReport020Controller.report020Details[2].project}" disabled="#{formReport020Controller.paramMode=='view'}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[2].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[2].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column><h:outputText value="#{formReport020Controller.report020Details[3].list}"/></p:column>  
                                    <p:column><p:inputText value="#{formReport020Controller.report020Details[3].project}" disabled="#{formReport020Controller.paramMode=='view'}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[3].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[3].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column>
                                        <p:inputText id="project4" value="#{formReport020Controller.report020Details[4].list}" disabled="#{formReport020Controller.paramMode=='view'}"/>
                                        <p:watermark for="project4" value="อื่นๆโปรดระบุ.." />
                                    </p:column>  
                                    <p:column>
                                        <p:inputText value="#{formReport020Controller.report020Details[4].project}" disabled="#{formReport020Controller.paramMode=='view'}"/>
                                    </p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[4].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[4].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column>
                                        <p:inputText disabled="#{formReport020Controller.paramMode=='view'}" id="project5" value="#{formReport020Controller.report020Details[5].list}"/>
                                        <p:watermark for="project5" value="อื่นๆโปรดระบุ.." />  
                                    </p:column>  
                                    <p:column>
                                        <p:inputText value="#{formReport020Controller.report020Details[5].project}" disabled="#{formReport020Controller.paramMode=='view'}"/>
                                    </p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[5].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[5].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column>
                                        <p:inputText disabled="#{formReport020Controller.paramMode=='view'}" id="project6" value="#{formReport020Controller.report020Details[6].list}"/>
                                        <p:watermark for="project6" value="อื่นๆโปรดระบุ.." />  
                                    </p:column>  
                                    <p:column>
                                        <p:inputText value="#{formReport020Controller.report020Details[6].project}" disabled="#{formReport020Controller.paramMode=='view'}"/>
                                    </p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[6].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[6].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column>
                                        <p:inputText disabled="#{formReport020Controller.paramMode=='view'}" id="project7" value="#{formReport020Controller.report020Details[7].list}"/>
                                        <p:watermark for="project7" value="อื่นๆโปรดระบุ.." />  
                                    </p:column>  
                                    <p:column>
                                        <p:inputText value="#{formReport020Controller.report020Details[7].project}" disabled="#{formReport020Controller.paramMode=='view'}"/>
                                    </p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[7].support}"/></p:column>  
                                    <p:column><totoland:inputNumber onchange="calSum()" disabled="#{formReport020Controller.paramMode=='view'}" value="#{formReport020Controller.report020Details[7].approve}"/></p:column>  
                                </p:row>
                                <p:row>
                                    <p:column><h:outputLabel value="รวม"/></p:column>  
                                    <p:column></p:column>  
                                    <p:column><h:outputLabel value="#{formReport020Controller.sumDetail.support}"/></p:column>  
                                    <p:column><h:outputLabel value="#{formReport020Controller.sumDetail.approve}"/></p:column>  
                                </p:row>
                            </p:panelGrid>
                            <p:confirmDialog global="true" showEffect="fade" hideEffect="explode">  
                                <p:commandButton value="#{msg.yes}" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/>  
                                <p:commandButton value="#{msg.no}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close"/>       
                            </p:confirmDialog> 
                        </p:panelGrid>
                    </div>
                    <h:panelGroup id="REPORT_020pnlCmd" rendered="#{formReport020Controller.report020.flowStatusId!=200}">
                        <div align="center">
                            <p:commandButton value="#{msg.btn_save}" actionListener="#{formReport020Controller.save()}" id="REPORT_020btnSave" rendered="#{formReport020Controller.paramMode=='create'}"/>
                            <p:commandButton value="#{msg.btn_edit}" actionListener="#{formReport020Controller.goToEdit()}" id="REPORT_020btnEdit" rendered="#{formReport020Controller.paramMode=='view' 
                                                      and formReport020Controller.canEdit(formReport020Controller.report020.createdUserGroup,formReport020Controller.report020.reportStatus,formReport020Controller.report020.flowStatusId)}"/>
                            <p:commandButton value="#{msg.btn_close}" actionListener="#{formReport020Controller.goToClose()}" id="REPORT_020btnClose" rendered="#{formReport020Controller.paramMode=='view' || formReport020Controller.paramMode=='create'}"/>
                            <p:commandButton value="#{msg.btn_save}" actionListener="#{formReport020Controller.edit()}" id="REPORT_020btnSaveEdit" rendered="#{formReport020Controller.paramMode=='edit'}"/>
                            <p:commandButton value="#{msg.btn_cancel}" id="REPORT_020btnCancel" actionListener="#{formReport020Controller.goToCancel()}" rendered="#{formReport020Controller.paramMode=='edit'}"/>
                        </div>
                    </h:panelGroup>
                </p:panel>               
            </p:panel>

        </h:form>
    </h:body>
</html>